/*
 * @(#)MockThrowableInvoker.java $version 2010. 8. 11
 *
 * Copyright 2007-2010 NHN Corp. All rights Reserved. 
 * NHN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.nhncorp.usf.core.exception;

import java.util.Map;

import com.nhncorp.usf.core.call.DefaultFault;
import com.nhncorp.usf.core.call.Fault;
import com.nhncorp.usf.core.invoker.DefaultInvocationFuture;
import com.nhncorp.usf.core.invoker.InvocationFuture;
import com.nhncorp.usf.core.invoker.Invoker;

/**
 * @author Web Platform Development Team
 */
public class MockThrowableInvoker implements Invoker {

    private String errorCode;

    private Map<Object, Object> detail;

    private String message;

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Map<Object, Object> getDetail() {
        return detail;
    }

    public void setDetail(Map<Object, Object> detail) {
        this.detail = detail;
    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public void dispose() {
    }

    public InvocationFuture invoke(String arg0, String arg1, Object... arg2) {
        DefaultInvocationFuture future = new DefaultInvocationFuture();

        Fault fault = new DefaultFault(
                errorCode,
                message,
                detail
        );

        future.setReady(fault);
        return future;
    }

    public boolean isValid() {
        return true;
    }

}
